<?php
/**
 * Created by PhpStorm.
 * User: andy
 * Date: 2019/8/29
 * Time: 下午2:22
 */

namespace app\api\controller;

use think\App;
use think\Controller;
use think\facade\Request;
use think\facade\Session;

class BaseController extends Controller
{
    protected $middleware = ['CrossDomain','CheckUser'];

    /**
     * 构造方法
     * AdminBaseController constructor.
     * @param Request $request
     * @param App|null $app
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function __construct(Request $request,App $app = null)
    {
        if (!session_id()) Session::start();
        parent::__construct($app);
    }

}